package com.pat.jrgwt.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.TabPanel;
import com.pat.jrgwt.shared.FuturesTradesAmountView;

public class Por3 extends Composite
{

    /**
     * Provides access to Sharpe ratio calculation
     */
    public DvSharpeRatioPor3 sharpeRatio = new DvSharpeRatioPor3();

    /**
     * Provides access to Archive performance of POR3
     */
    public ArchivePerfPor3 archivePerformance = new ArchivePerfPor3();
    
    /**
     * Holds instance of Por3
     * 
     * @author Aleksej V.
     */
    private static class SingletonHolder
    {
        private static final Por3 instance = new Por3();
    }

    private Por3()
    {
        TabPanel tp = new TabPanel();
        
        ProfitLossesPor3View plView = ProfitLossesPor3View.getInstance();
        tp.add(plView, "P/L system");
        
//        archive.r
//        archive.redrawFull();
        tp.add(archivePerformance, "Archive Perf");
        
        tp.add(sharpeRatio, "DV Sharpe ratio");
        
        EuroConversion ec = EuroConversion.getInstance();
        tp.add(ec, "Euro conversion");
        
        tp.selectTab(2);
        tp.selectTab(0);
        
        initWidget(tp);
    }
    
    /**
     * Returns the only instance of Por3 object
     */
    public static Por3 getInstance()
    {
        return SingletonHolder.instance;
    }
    
}
